'use strict'

// const unless = require('koa-unless')

module.exports = (option, app) => {
  return async function (ctx, next) {

	const auth = app.passport.authenticate('jwt', 
		{ session:false, successReturnToOrRedirect:null });
	// auth.unless = unless
	//const aa = auth(ctx, next)
	return await auth(ctx, next)
	
  }
}